import 'package:boss/color_constant.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/widget/calendar/provider/calendar_provider.dart';
import 'package:boss/ui/widget/image/base_image.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class CalendarTitleBar extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      margin: EdgeInsets.only(
        top: 50.w,
        bottom: 15.w,
      ),
      child: Consumer<CalendarProvider>(
        builder: (context, provider, child) {
          return Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              GestureDetector(
                onTap: provider.prevPage,
                behavior: HitTestBehavior.translucent,
                child: Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: BaseImage(
                    'assets/image/calendar_left_icon.png',
                    width: 14.w,
                    height: 26.w,
                    color: ColorConstant.ff33,
                  ),
                ),
              ),
              Container(
                margin: EdgeInsets.symmetric(
                  horizontal: 6,
                ),
                child: Text(
                  provider.titleText,
                  style: TextStyleConstant().normal_1_32,
                ),
              ),
              GestureDetector(
                onTap: provider.nextPage,
                behavior: HitTestBehavior.translucent,
                child: Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: BaseImage(
                    'assets/image/calendar_right_icon.png',
                    width: 14.w,
                    height: 26.w,
                    color: ColorConstant.ff33,
                  ),
                ),
              ),
            ],
          );
        },
      ),
    );
  }
}
